To use the program, you should include it as part of your installation. Extract it to known location (probably $TEMP), and then launch the program using ExecWait. The program takes 1 command line argument, which is the name of an INI file.
The INI file has one required section. This section includes the handle to the NSIS window and the number of controls to be created. The INI file also includes a variable number of Field sections which are used to create the controls to be displayed.
The required section is named "Settings". It will contain the following values:
| Title | (optional) | If specified, gives the text to set the titlebar to. Otherwise, the titlebar text is not changed. |
| Caption | (optional) | A caption to display in the top-left corner of the window. |
| ParentWnd | (required) | The HWND of the main NSIS window. To get this value, use WriteINIStr and $HWNDPARENT from your script right before launching the options dialog. |
| NumFields | (required) | The number of control elements to be displayed on the dialog window. |
Each field section has the heading "Field #" where # must be sequential numbers from 1 to NumFields. Each Field section contains the following values:
| Type | (required) | Type of control to be created. Valid values are "Label", "Text", "Password", "Combobox", "DropList", "FileRequest", or "DirRequest". A "label" is used to display static text. (i.e. a caption for a textbox) A "textbox" and "password" accept text input from the user. "password" masks the input with * characters. A "combobox" allows the user to type text not in the popup list, a "droplist" only allows selection of items in the list. A "FileRequest" control displays a textbox and a browse button. Clicking the browse button will display a file requester where the user can browse for a file. A "DirRequest" control displays a textbox and a browse button. Clicking the browse button will display a directory requester where the user can browse for a directory. |
||||||||||||
| Text | (optional) | Specifies the caption of a label control, or the initial text for a textbox. | ||||||||||||
| ListItems | (optional) | A list of items to display in a combobox or droplist. | ||||||||||||
| MaxLen | (optional) | Causes validation on the selected control to limit the maximum length of text. If the user specifies more text than this, a message box will appear when they click "OK" and the dialog will not be dismissed. You should not use this on a "combobox" since the user can not control what is selected. This should be set to a maximum of 260 for "FileRequest" and "DirRequest" controls. Ignored on "label" controls. |
||||||||||||
| MinLen | (optional) | Causes validation on the selected control to force the user to enter a minimum amount of text. If the user specifies less text than this, a message box will appear when they click "OK" and the dialog will not be dismissed. Unlike MaxLen, this is useful for "Combobox" controls. By setting this to a value of "1" the program will force the user to select an item. Ignored on "label" controls. |
||||||||||||
| ValidateText | (optional) | If a particular field fails the test for "MinLen" or "MaxLen", a messagebox will be displayed with this text. NOTE: The only formatting performed on this text is "\n" will be replaced with a newline in the messagebox. |
||||||||||||
| Left Right Top Bottom |
(required) | The position on the dialog where this control appears. Sorry, no GUI here to help you. NOTE: For combobox or droplist, the "bottom" value is not used in the same way. In this case, the bottom value is the maximum size of the window when the pop-up list is being displayed. All other times, the combobox is automatically szed to be one element tall. If you have trouble where you can not see the combobox drop-down, then check the bottom value and ensure it is large enough. NOTE (2): FileRequest and DirRequest controls will allocate 20 pixels to the browse button. Make this control wide enough the contents of the textbox can be seen. |
||||||||||||
| Filter | (optional) | Specifies the filter to be used in the "FileRequest" control. This is constructed by putting pairs of entries together, each item seperated by a | character. The first value in each pair is the text to display for the filter. The second value is the pattern to use to match files. For example, you might specify:
NOTE: you should not put any extra spaces around the | characters. |
||||||||||||
| Flags | (optional) | This specifies additional flags for the display of different controls.
Each value should be seperated by a | character, and you should be careful not to put any spaces around the | character.
|
Copyright © 2001 Michael Bishop
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.